<template>
	<div class="mt10">
		<CardList v-if="visible" @check-add="onCheckAdd">
			<el-button @click="onCheckAdd({})" type="primary">新建数据统计</el-button>
		</CardList>
		<operateForm v-else @refresh="onRefresh" :nowRowData="nowRowData">
			<el-button text @click="visible = !visible" type="primary"> <span class="text-gray">快速数据统计</span> / 新建数据统计 </el-button>
		</operateForm>
	</div>
</template>

<script setup lang="ts">
import CardList from './components/CardList/index.vue'
import operateForm from './components/operateForm/index.vue'
const visible = ref(true)

const nowRowData:any = ref({})
const onRefresh = ()=> {
  visible.value = true
}

const onCheckAdd = (item)=> {
  visible.value =false
  nowRowData.value = item
}
</script>
<style scoped lang="scss"></style>
